package com.zzy.furns.dao.impl;

import com.zzy.furns.dao.BasicDAO;
import com.zzy.furns.dao.OrderDAO;
import com.zzy.furns.domain.Order;

public class OrderDAOImpl extends BasicDAO<Order> implements OrderDAO {
    @Override
    public Integer saveOrder(Order order) {
        String sql = "INSERT INTO `order`(id,create_time,price,`status`,member_id) VALUES(?,?,?,?,?)";
        return update(sql,order.getId(),order.getCreateTime(),order.getPrice(),order.getStatus(),order.getMemberId());
    }

    @Override
    public Order queryOrderByOrderId(String orderId) {
        String sql = "SELECT id,create_time AS  createTime,price,`status`,member_id AS memberId FROM `order` WHERE id = ?";
        return querySingle(sql, Order.class,orderId);
    }
}
